package com.etc.order.consumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.etc.order.common.domain.User;
import com.etc.order.common.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class UserController {
    @Resource
    @Reference
    private UserService userService;

    @GetMapping("/getUser")
    @ResponseBody
    public User user(){
        System.out.println("进来了！！！！！！！！！！！！！！！！");
        System.out.println(userService.hashCode()+"!!!!!!!!!!!!!!!!");
        return userService.findUser();
    }

    @GetMapping("/403")
    public String err() {
        return "403";
    }
}
